<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后盾人</title>
    <script src='https://code.jquery.com/jquery-3.3.1.slim.min.js'></script>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        main {
            width: 100vw;
            height: 100vh;
            transform-style: preserve-3d;
            transform: perspective(900px);
            transition: 2s;
        }

        main.login {
            transform: perspective(900px) rotateY(0deg);
        }

        main.register {
            transform: perspective(900px) rotateY(180deg);
        }

        /* body:hover main {
            transform: perspective(900px) rotateY(180deg);
        } */

        div {
            position: absolute;
            width: 100%;
            height: 100%;
            background: #000;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            font-size: 4em;
            text-transform: uppercase;
            color: white;
            backface-visibility: hidden;
        }

        div i[class^="fa"] {
            font-size: 1.8em;
        }

        div span {
            font-size: .2em;
            color: #ecf0f1;
            opacity: .8;
        }

        div:nth-child(1) {
            background: #8e44ad;
        }

        div:nth-child(2) {
            background: #e74c3c;
            transform: rotateY(180deg);
        }

        nav {
            position: absolute;
            width: 100%;
            bottom: 60px;
            text-align: center;
        }

        nav a {
            padding: 10px 20px;
            background: #34495e;
            margin-right: 10px;
            color: white;
            text-decoration: none;
        }
    </style>
</head>

<body>
    <main>
        <div>
            <i class="fa fa-home" aria-hidden="true"></i>
            login
            <span>houdunren.com</span>
        </div>
        <div>
            <i class="fa fa-user" aria-hidden="true"></i>
            register
            <span>houdunren.com</span>
        </div>
    </main>
    <nav>
        <a href="javascript:;" onclick="change('login')">登录</a>
        <a href="javascript:;" onclick="change('register')">注册</a>
    </nav>
    <script>
        function change(t) {
            switch (t) {
                case 'login':
                    $("main").removeClass().addClass('login');
                    break;
                case 'register':
                    $("main").removeClass().addClass('register');
                    break;
            }
        }
    </script>
</body>

</html>